package com.sdy.common.constant;


/**
 * Created by zzq on 2017-08-27.
 */
public class Constants {

    public static final String HEADER_AUTHORIZATION = "Authorization";
    public static final String SESSION_USER_ID = "userId";
    public static final String LOGIN_VALIDATE_CODE = "login_validate_code"; // 登录图片验证码
    public static final String LOGIN_TOKEN = "login_token"; // 登录token
    public static final String PASSWORD_ERROR_REDIS = "password_error_redis"; // 登录token
    public static final Integer LOGIN_RETRY_MINUTES = 20;
    public static final Integer LOGIN_MAX_ERROR_TIMES = 5;
    public static final Integer RESOURCE_REDIS_CACHE_SECONDS = 60;

    /*********************** regex **********************/
    /**
     * 正则表达式：验证用户名
     */
    public static final String REGEX_USERNAME = "^[a-zA-Z]\\w{1,20}$";
    /**
     * 正则表达式：验证手机号
     */
//    webapp static final String REGEX_PHONE = "^1((3[(0-3)(5-9)]|49|5[0-35-9]|66|7[35-8]|8[0-9]|9[89])[0-9]|34[0-8])[0-9]{7}$";
    public static final String REGEX_PHONE = "^1[0-9]{10}$";
    /**
     * 正则表达式：验证身份证
     */
    public static final String REGEX_ID_CARD = "(^\\d{18}$)|(^\\d{15}$)|(^\\d{17}[a-z]$)";
    
    public static final String REGEX_IPV4 = "^(?=(\\b|\\D))(((\\d{1,2})|(1\\d{1,2})|(2[0-4]\\d)|(25[0-5]))\\.){3}((\\d{1,2})|(1\\d{1,2})|(2[0-4]\\d)|(25[0-5]))(?=(\\b|\\D))$";

    public static final String UPLOAD_FILE_PATH = "/opt/file";

    public static final String NO_DATA_AUTH = "没有访问权限";
}
